home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 September
/
Macworld (1998-09).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop 1.8.3
/
Required Classes
/
Z Sources
/
ZErrors.cpp
< prev
next >
Wrap
Text File
|
1998-07-06
|
1KB
|
99 lines
/*************************************************************************************************
*
*
* MacZoop - "the framework for the rest of us"
*
*
*
* ZErrors.cpp -- utils for throwing exceptions
*
*
*
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#include "ZErrors.h"
#include "ZDefines.h"
void FailNIL( void* aPtr )
{
if ( aPtr == NULL )
throw memFullErr;
}
void FailOSErr( OSErr theErr )
{
if ( theErr != noErr )
throw theErr;
}
void FailMemError()
{
FailOSErr( MemError());
}
void FailResError()
{
FailOSErr( ResError());
}
void Fail()
{
FailOSErr( kUnknownExceptionErr );
}
void FailNILRes( void* aResPtr )
{
if ( aResPtr == NULL )
FailOSErr( resNotFound );
}
void FailSilent()
{
FailOSErr( kSilentErr );
}
void FailParamErr( OSErr theErr )
{
if ( theErr != noErr )
FailOSErr( kMacZoopParamErr1 );
}
void FailNILParam( void* aPtr )
{
if ( aPtr == NULL )
FailOSErr( kMacZoopParamErr );
}
void FailNILErr( void* aPtr, OSErr err )
{
if ( aPtr == NULL )
{
if ( err == noErr )
throw kUnknownExceptionErr;
else
throw err;
}
}